﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ExFlash.Records;

namespace ExFlash.Tags
{
    public class DefineFontNameTag : Tag, IReferenceCharacterId
    {
        private readonly int _swfVersion;

        public ushort FontId
        {
            get;
            protected set;
        }

        public StringRecord FontName
        {
            get;
            protected set;
        }

        public StringRecord FontCopyright
        {
            get;
            protected set;
        }

        public DefineFontNameTag(int len, int version, int offset)
            : base(TagCodes.DefineFontName, len, offset)
        {
            _swfVersion = version;
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            FontId = reader.ReadUInt16();
            FontName = new StringRecord(_swfVersion);
            FontName.SwfDeserialize(reader);

            FontCopyright = new StringRecord(_swfVersion);
            FontCopyright.SwfDeserialize(reader);
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }

        public bool IsReferencing
        {
            get { throw new NotImplementedException(); }
        }

        public ushort ReferencedId
        {
            get { return FontId; }
        }

        public IEnumerable<Type> ReferencedAttributes
        {
            get { throw new NotImplementedException(); }
        }

        public Type ReferencedType
        {
            get { throw new NotImplementedException(); }
        }
    }
}
